package com.it.mmx.memory.circuit.breaker.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * 内存熔断配置属性
 */
@ConfigurationProperties(prefix = "memory.circuitbreaker")
public class MemoryCircuitBreakerProperties {

    /**
     * 是否开启内存熔断功能（默认关闭）
     */
    private boolean enabled = false;

    /**
     * 需要熔断的路径（支持Ant风格表达式，如/api/**）
     */
    private List<String> apiPaths = new ArrayList<>();

    /**
     * 触发熔断的剩余内存阈值（百分比，默认20%）
     */
    private double thresholdPercent = 20.0;

    // Getters & Setters
    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public List<String> getApiPaths() {
        return apiPaths;
    }

    public void setApiPaths(List<String> apiPaths) {
        this.apiPaths = apiPaths;
    }

    public double getThresholdPercent() {
        return thresholdPercent;
    }

    public void setThresholdPercent(double thresholdPercent) {
        this.thresholdPercent = thresholdPercent;
    }
}
